package cn.edu.xmu.oomall.order.microservice;


import cn.edu.xmu.oomall.core.config.OpenFeignConfig;
import cn.edu.xmu.oomall.core.util.Common;
import cn.edu.xmu.oomall.core.util.ReturnObject;
import cn.edu.xmu.oomall.order.microservice.vo.FreightCalculatingPostVo;
import cn.edu.xmu.oomall.order.microservice.vo.FreightCalculatingRetVo;
import cn.edu.xmu.oomall.order.util.ValidList;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(name = "freight-service", configuration = OpenFeignConfig.class)
public interface FreightService {

    /** 内部API-计算一批商品的运费 */
    @PostMapping("/regions/{rid}/price")
    InternalReturnObject<FreightCalculatingRetVo> calculateFreight(@PathVariable Long rid, @Validated @RequestBody
                                                                  ValidList<FreightCalculatingPostVo> items);
    // BindingResult bindingResult

}
